#region Summary

// 
// Owner : JackieHan 
// 
// Solution : DailyCollection 
// 
// Project : Jackie.Utility.Condition
// 
// File : Equal.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 判断条件相等的关键字定义
// 
// History : 
//			2011-05-26 09:50:01	    Create 
// 

#endregion

#region Using

using System;
using System.Text.RegularExpressions;
using Jackie.Utility.Condition.Domain.Interface;

#endregion

namespace Jackie.Utility.Condition.Domain.Define
{
    /// <summary> 
    /// 判断条件相等的关键字定义
    /// </summary>
    public class Equal : IKeyWord
    {
        private const string EqualKeyWordRegex = "^={1,2}$";
        private const int EqualKeyWordLength = 2;

        public bool Is(string text)
        {
            var regex = new Regex(EqualKeyWordRegex);
            return regex.IsMatch(text);
        }

        public int Lenght
        {
            get { return EqualKeyWordLength; }
        }

        public override string ToString()
        {
            return "Equal";
        }
    }
}